//
//  QSShareViewController.m
//  DigitalEconomy_iOS
//
//  Created by Ding on 2020/5/18.
//  Copyright © 2020 DingC. All rights reserved.
//

#import "QSShareViewController.h"
#import "QSMyShareView.h"

@interface QSShareViewController ()
@property (nonatomic, strong) QSMyShareView *shareView;

@end

@implementation QSShareViewController
#pragma mark - **************** Life Cycle
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault animated:NO];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"分享";
    [self.view addSubview:self.shareView];

}
#pragma mark - **************** Event Response
- (void)shareViewDidClickShareButton {
    [[QSShareHelper sharedHelper] shareWebPageWithTitle:kAppName
                                                    des:kAppName
                                                    url:kShareAppURL
                                               imageURL:@"https://pk-m.hzqisheng.cn/appimg/fenxiang.png"
                                             completion:^(id result, NSError *error) {
                                                 
                                             }];
}

#pragma mark - **************** Setter Getter
- (QSMyShareView *)shareView {
    if (!_shareView) {
        _shareView = [[QSMyShareView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight - kNavgationBarHeight - kiPhoneXSafeAreaBottomMagin)];
        WeakSelf(weakSelf);
        _shareView.myShareViewDidClickShareButtonBlock = ^{
            [weakSelf shareViewDidClickShareButton];
        };
    }
    return _shareView;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
